<%@ page language="java"  pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/struts-tags.tld" prefix="s"%>
<!DOCTYPE html>
<html lang="zh">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>用户注册-沈阳外卖网</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- Bootstrap -->
<link href="publicui/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen" />
<!--[if lt IE 9]>
  <script src="public/js/html5shiv.js"></script>
<![endif]-->
<!-- application  -->
<link href="css/head.css" rel="stylesheet" />
<link href="css/foot.css" rel="stylesheet" />
<link href="css/reg.css" rel="stylesheet" />
</head>
<body >
<div class="body_bg" >
<!-----nav-->
<s:action name="shopTop" executeResult="true"></s:action>
<!---/nav   --> 

<!---/body   -->
<div class="content" > 
<!--   content  -->
<div class="loginpage">
 <div class="loginpage_img"></div>
 <div  class="login_box" > 
 <div class="content">
	<div id="tab" >
		<ul>
			<li class="login_link_off" >
				<a href="shopkeeper_login.action"><span>店员登录</span> </a>
			</li>
			<li class="reg_link_on" >
				<a href="shopkeeper_reg.action"><span>免费注册</span> </a>
			</li>
		</ul>
	</div>
	<div id="login_form_div" class="hidden" >
	</div>
	<div id="register_form_div">
	<form method="post" action="shopkeeper_reg.action" id="restautant">
		<input type="hidden" name="action" value="restaurant"/>
		<div class="field_line mbt5">
			<span class="red">*</span> 店主姓名<span class="success4" id="shopkeeperNameMsg"></span>
		</div>
		<div class="field_line mbt5">
			<input type="text" name="shopkeeperName" id="shopkeeperName" maxlength="20" class="input_text"/>
		</div>
		<div class="field_line mbt5">
			<span class="red">*</span> 移动电话<span class="success4" id="phoneMsg"></span>
		</div>
		<div class="field_line mbt5">
			<input type="text" name="phone" id="phone" maxlength="20" class="input_text"/>
		</div>
		<div class="field_line mbt5">
			<span class="red">*</span>固定电话（选填）<span class="success4" id="passfirmMsg"></span>
		</div>
		<div class="field_line mbt5">
			<input type="text" name="phone2" id="phone2" maxlength="20" class="input_text"/>
		</div>
		<div class="field_line mbt5">
			<span class="red">*</span>QQ号<span class="success4" id="qqMsg"></span>
		</div>
		<div class="field_line mbt5">
			<input type="text" name="qq" id="qq" maxlength="20" class="input_text"/>
		</div>
		<div class="field_line mbt5">
			<span class="red">*</span>餐厅名称<span class="success4" id="resNameMsg"></span>
		</div>
		<div class="field_line mbt5">
			<input type="text" name="resName" id="resName" maxlength="20" class="input_text"/>
		</div>
		<div class="field_line mbt5">
			<span class="red">*</span>餐厅地址<span class="success4" id="addressMsg"></span>
		</div>
		<div class="field_line mbt5">
			<input type="text" name="address" id="address" maxlength="20" class="input_text"/>
		</div>
		<div class="field_line mbt5">
			<span class="red">*</span>餐厅描述<span class="success4" id="summaryMsg"></span>
		</div>
		<div class="field_line mbt5">
			<textarea rows="4" cols="30" name="summary" id="summary" class="input_text"></textarea>
		</div>
		<div class="field_line mbt5">
			<span class="red">*</span>餐厅公告<span class="success4" id="noticeMsg"></span>
		</div>
		<div class="field_line mbt5">
			<textarea rows="4" cols="30" name="notice" id="notice" class="input_text"></textarea>
		</div>
		<div class="field_line mbt5">
			<span class="red">*</span>网店地址<span class="success4" id="webKeyMsg"></span>
		</div>
		<div class="field_line mbt5">
			http:///<input type="text" name="webKey" id="webKey" maxlength="20" class="input_text"/>
		</div>
		<div class="field_line mbt5">
			<span class="reg_button_wrapper">
				<button tabindex="5" type="button" class="btn btn-warning"
															 onclick="VF_restautantflag(); return false;">
															保存信息
														</button></span>
		</div>
	</form>

</div>
</div>
 </div>
</div>
<!--   /content  -->
    <s:action name="foot" executeResult="true"></s:action>
</div>
<!--  alert div start---->
<div id="copy_dlg_restaurant"  class="restaurant-hover-dlg right hide" >
  <div class="wrapper dark_shadow">
    <div class="callout_tip"></div>
    <div class="detail"> </div>
  </div>
</div>
<!--  alert div  end ---->

<!---/body   --> 

</div>
<script src="publicui/js/jquery-1.8.3.js"></script> 
<script src="publicui/jquery-ui/js/jquery-ui-1.9.2.custom.js"></script> 
<script src="publicui/bootstrap/js/bootstrap.min.js"></script> 
<script src="js/head.js"></script>
<script language="JavaScript" type="text/javascript">
function checkShopkeeperName(){
	var shopkeeperName = $('#shopkeeperName').val();
	var regu =/^(.){2,6}$/;
	var re = new RegExp(regu);
	if (re.test(shopkeeperName)) {
		$('#shopkeeperNameMsg').html('<img src="../images/check_right.gif" width="16" height="16">');
   		return true;
	}else{
		$('#shopkeeperNameMsg').html('请您按照正确格式填写店主姓名');
   		return false;
	}
}
function checkPhone(){
	var phone = $('#phone').val();
	var regu =/^(13|14|15|18)\d{9}$/;
	var re = new RegExp(regu);
	if (re.test(phone)) {
		$('#phoneMsg').html('<img src="../images/check_right.gif" width="16" height="16">');
   		return true;
	}else{
		$('#phoneMsg').html('请您按照正确格式填写移动电话');
   		return false;
	}
}
function checkQQ(){
	var qq = $('#qq').val();
	var regu =/^\d*?$/;
	var re = new RegExp(regu);
	if (re.test(qq)) {
		$('#qqMsg').html('<img src="../images/check_right.gif" width="16" height="16">');
   		return true;
	}else{
		$('#qqMsg').html('请您按照正确格式填写QQ号');
   		return false;
	}
}
function checkResName(){
	var resName = $('#resName').val();
	var regu =/^[\s\S]*$/;
	var re = new RegExp(regu);
	if (re.test(resName)) {
		$('#resNameMsg').html('<img src="../images/check_right.gif" width="16" height="16">');
   		return true;
	}else{
		$('#resNameMsg').html('请您按照正确格式填写餐厅名称');
   		return false;
	}
}
function checkAddress(){
	var address = $('#address').val();
	var regu =/^[\s\S]*$/;
	var re = new RegExp(regu);
	if (re.test(address)) {
		$('#addressMsg').html('<img src="../images/check_right.gif" width="16" height="16">');
   		return true;
	}else{
		$('#addressMsg').html('请您按照正确格式填写餐厅地址');
   		return false;
	}
}
function checkSummary(){
	var summary = $('#summary').val();
	var regu =/^[\s\S]*$/;
	var re = new RegExp(regu);
	if (re.test(summary)) {
		$('#summaryMsg').html('<img src="../images/check_right.gif" width="16" height="16">');
   		return true;
	}else{
		$('#summaryMsg').html('请您按照正确格式填写餐厅描述');
   		return false;
	}
}
function checkNotice(){
	var notice = $('#notice').val();
	var regu =/^[\s\S]*$/;
	var re = new RegExp(regu);
	if (re.test(notice)) {
		$('#noticeMsg').html('<img src="../images/check_right.gif" width="16" height="16">');
   		return true;
	}else{
		$('#noticeMsg').html('请您按照正确格式填写餐厅公告');
   		return false;
	}
}
function checkWebKey(){
	var webKey = $('#webKey').val();
	var regu =/^\d*?$/;
	var re = new RegExp(regu);
	if (re.test(webKey)) {
		$('#webKeyMsg').html('<img src="../images/check_right.gif" width="16" height="16">');
   		return true;
	}else{
		$('#webKeyMsg').html('请您按照正确格式填写网店地址');
   		return false;
	}
}
function VF_restautantflag(){
	var check_bl01=checkShopkeeperName();
	var check_bl02=checkPhone();
	var check_bl03=checkQQ();
	var check_bl04=checkResName();
	var check_bl05=checkAddress();
	var check_bl06=checkSummary();
	var check_bl07=checkNotice();
	//alert(check_bl01  +"|"+ check_bl02  +"|"+ check_bl03 +"|"+ check_bl04 +"|"+ check_bl05 +"|"+ check_bl06 +"|"+ check_bl07)
	if(check_bl01  && check_bl02  && check_bl03 && check_bl04 && check_bl05 && check_bl06 && check_bl07){
		$('#restautant').submit();
	}
}
</script>
<s:if test="error!=null&&error!=''">
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">提示</h3>
  </div>
  <div class="modal-body">
    <p><s:fielderror><s:param>error</s:param></s:fielderror></p>
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
   <!-- <button class="btn btn-primary">确定 </button>   -->
  </div>
</div>
<script type="text/javascript"  >
$('#myModal').modal();
</script>
</s:if>
</body> 
</html>
<!-- haha! everyone is a frontier -->

